{% load static %}
{% load common_extras %}

<div class="chat-left">
    {% for sender in senders %}
        <a href="/chat/chat/message/{{ sender.id }}">
            <div class="user">
            <div class="avatar">
                <img src="/static/media/{{ sender.cover }}" alt="发送人头像">
            </div>
            <div class="desc">
                <div class="name">
                    <span>{{ sender.username }}</span>
                    {% if sender.is_following %}
                        <div class="status">已关注</div>
                        {% else %}
                        <div class="status">未关注</div>
                    {% endif %}
                </div>
                {% if sender.message|length <= 6  %}
                    <div class="msg">{{ sender.message }}</div>
                {% else %}
                    <div class="msg">{{ sender.message|slice:":5"|joint:"..." }}</div>
                {% endif %}
            </div>
        </div>
        </a>
    {% empty %}
        <p style="padding: 10px;color: gray;">还没有人私信你哦~~</p>
    {% endfor %}
</div>